#version 460 core
in vec3 iVertex;
in vec3 iNormal;
in vec2 iTexcoord;

out vec3 ioNormal;
out vec3 ioViewVector;
out vec2 ioTexcoord;

out vec3 position;

uniform mat4 osg_ViewMatrix;
uniform mat3 osg_NormalMatrix;
uniform mat4 osg_ModelViewProjectionMatrix;

void main()
{
	vec4 vextex = vec4(iVertex, 1.0);
	
	ioNormal = osg_NormalMatrix * iNormal;
	ioViewVector = -vec3(osg_ViewMatrix * vextex);
	ioTexcoord = iTexcoord;

	position = iVertex;
	gl_Position =  osg_ModelViewProjectionMatrix * vextex;
}